<%@LANGUAGE="VBSCRIPT" CODEPAGE="1251"%>
<html>
<head>
<%
  if session("Acc")<>1 then response.Redirect "../../default.asp"
  if session("sesAutomat")<>3 then response.Redirect "../../default.asp"
%>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Untitled Document</title>
<link href="../../Style/MainPageStyle.css" rel="stylesheet" type="text/css">
<link href="../../Style/Table.css" rel="stylesheet" type="text/css">
</head>
<!--#include file="../../Connect/Connection.asp"-->
<!--#include file="../../Connect/adovbs.inc"-->
<%
	DTA=Request.Form("DateL")&" "&Request.Form("Hr1")&":"&Request.Form("min1")&":"&Request.Form("sec1")
	Dim Answer
		if session("sesLogon")="" then session("sesLogon")=Request.ServerVariables.Item("REMOTE_ADDR") 

	IF Request.Form("txtAut")<>"" AND Request.Form("txtSum")<>"" THEN
		IF isNumeric(Request.Form("txtSum")) THEN
					Set cnn=Server.CreateObject("ADODB.Connection")
					Set cmd=Server.CreateObject("ADODB.Command")
					cnn.open connStr&";Initial Catalog=meps"
				
					With cmd
						.ActiveConnection = cnn
						.CommandType = adCmdStoredProc
						.Commandtext = "sp_AutomatCorrectIncasPut"	
						.Parameters.Append .CreateParameter("@RegNumber", adInteger, adParamInput)
						.Parameters.Append .CreateParameter("@UserID", adVarChar, adParamInput, 50)
						.Parameters.Append .CreateParameter("@Summa", adInteger, adParamInput)
						.Parameters.Append .CreateParameter("@AmountBanknot", adInteger, adParamInput)
						.Parameters("@RegNumber")=Request.Form("txtAut")
						.Parameters("@UserID")=session("sesLogon")
						.Parameters("@Summa")=Request.Form("txtSum")
						.Parameters("@AmountBanknot")=Request.Form("txtBnknt")
						.Execute
					End with
					set cmd=nothing
					cnn.close
					set cnn=nothing
				response.redirect "CorrectInkass.asp?mess=ok"
		ELSE
			response.redirect "CorrectInkass.asp?mess=Num"
		END IF
	ELSE
			response.redirect "CorrectInkass.asp?mess=NLL"
	END IF
%>
<body>
</body>
</html>
